<?php

class Zhishidi_Express_IndexController extends Mage_Core_Controller_Front_Action {

    public function indexAction() {
        $typeCollection = Mage::getModel('zhishidi_express/type')->getCollection()->addVisibleFilter();
        $country = 'US';
        $state = 'District of Columbia';
        $weight = 20000;
        $carrier = array();
 
        $carriers = Mage::getModel('zhishidi_express/express')->getExpress($weight, $country, $state);
        $costArray = array();
        foreach ($carriers as $carrierCode => $carrier) {
                $costArray[] = $carrier['cost'];
            }


        $minShippingCost =  min($costArray);

         foreach ($carriers as $carrierCode => $carrier) {
             $cost = $carrier['cost'] - $minShippingCost < 0?0:$carrier['cost'] - $minShippingCost;
             $carriers[$carrierCode]['cost'] = $cost;
         }

         var_dump($carriers);
    }

}

?>
